import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const modules = import.meta.globEager('./home/*.ts')
export const routerList = Object.values(modules).map(item=>item.default).sort((a,b)=>a.sort-b.sort)
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    redirect:"/edit",
    meta: {
      title: "首页",
      keepAlive: true,
      iocn: "AppstoreOutlined",
    },
    component: () => import("../views/Layout/index.vue"),
    children:routerList
  },
  {
    path: "/login",
    name: "Login",
    meta: {
      title: "登录",
      keepAlive: true,
      iocn: "AppstoreOutlined",
    },
    component: () => import("../views/Login/index.vue"),
  },
  {
    path: "/edit",
    name: "电子看板",
    meta: {
      title: "电子看板",
      keepAlive: true,
      show:false,
      iocn: "AppstoreOutlined",
    },
    component: () => import("../views/Edit/index.vue"),
  },
  {
    path: "/Look",
    name: "预览",
    meta: {
      title: "预览",
      keepAlive: true,
      show:false,
    },
    component: () => import("../views/Look/index.vue"),
  }

];
export const router = createRouter({
  history: createWebHashHistory(),
  routes
});

